package com.xiaoxu.mp.controller;


import com.xiaoxu.mp.service.IAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 晓虚
 * @since 2025-04-08
 */
@Api(tags = "地址管理接口")
@RequestMapping("/address")
@RestController
//@AllArgsConstructor //所有的成员都构造
@RequiredArgsConstructor //必要的成员变量注入
public class AddressController {

    private final IAddressService addressService;

    @ApiOperation("删除对应的地址")
    @DeleteMapping("/{id}")
    public void deleteAddress(@ApiParam("删除地址id") @PathVariable Integer id) {
        addressService.removeById(id);
    }

}
